<h1>DefineShape</h1>

<p>DefineShape defines a shape to be displayed.</p>

<table>

<tr>
<th nowrap>Field Name</th>
<th>Type</th>
<th>Size</th>
<th>Description</th>
</tr>

<tr>
<td nowrap valign="top">type</td>
<td nowrap valign="top">unsigned bit</td>
<td nowrap valign="top" align="right">10</td>
<td>Identifies the DefineShape instruction when it is encoded. It is encoded 
with the length field as a 16-bit integer (Little-endian byte order).</td>
</tr>

<tr>
<td nowrap valign="top">length</td>
<td nowrap valign="top">unsigned bit</td>
<td nowrap valign="top" align="right">6</td>
<td>The length in bytes of the body of the instruction when it is encoded. If the length is greater 
than 62 then this field is set to 0x3F and the length is encoded using the 
extendedLength field. Encoded with the type field as a 16-bit integer.</td>
</tr>

<tr>
<td nowrap valign="top">extendedLength</td>
<td nowrap valign="top">unsigned int</td>
<td nowrap valign="top" align="right">32</td>
<td>Optional. Contains the length in bytes of the encoded instruction if it is
greater than 62 bytes. If the length is 62 bytes or less then this field is 
omitted.</td>
</tr>

<tr>
<td nowrap valign="top">identifier</td>
<td nowrap valign="top">unsigned int</td>
<td nowrap valign="top" align="right">16</td>
<td>The unique identifier for this shape. This is used when adding or removing 
the shape from the display list or when the shape is used as part of another 
object such as a button.</td>
</tr>

<tr>
<td nowrap valign="top">bounds</td>
<td nowrap valign="top">Bounds</td>
<td nowrap valign="top" align="right">&nbsp;</td>
<td>The bounding area inside which the shape is drawn.</td>
</tr>

<tr>
<td nowrap valign="top">fillStyleCount</td>
<td nowrap valign="top">unsigned int</td>
<td nowrap valign="top" align="right">8</td>
<td>The number of fill styles following.</td>
</tr>

<tr>
<td nowrap valign="top">fillStyles</td>
<td nowrap valign="top">FillStyle</td>
<td nowrap valign="top" align="right">&lt;fillStyleCount&gt;</td>
<td>Optional. An array of fill styles used to fill the area enclosed by the 
shape. Fill styles are not necessary to define a shape if only the outline is 
to be displayed.</td>
</tr>

<tr>
<td nowrap valign="top">lineStyleCount</td>
<td nowrap valign="top">unsigned int</td>
<td nowrap valign="top" align="right">8</td>
<td>The number of line styles following.</td>
</tr>

<tr>
<td nowrap valign="top">lineStyles</td>
<td nowrap valign="top">LineStyle</td>
<td nowrap valign="top" align="right">&lt;lineStyleCount&gt;</td>
<td>Optional. An array of line styles used to fill the area enclosed by the 
shape. Line styles are not necessary to define a shape if only the area is 
filled and no outline is drawn.</td>
</tr>

<tr>
<td nowrap valign="top">shape</td>
<td nowrap valign="top">Shape</td>
<td nowrap valign="top" align="right">&nbsp;</td>
<td>A Shape containing Lines, Curves and ShapeStyles that describe 
how the shape is drawn and filled.</td>
</tr>

</table>

<p>The shape defines a path containing a mix of straight and curved edges and 
pen move actions. A path need not be contiguous. When the shape is drawn a 
ShapeStyle selects the line and fill styles, from the respective array, to be 
used. ShapeStyles can be defined in the shape at any time to change the styles 
being used. The fill style used can either be a solid colour, a bitmap image or 
a gradient. The line style specifies the colour and thickness of the line drawn 
around the shape outline.</p>

<p>For both line and fill styles the selected style may be undefined, allowing 
the shape to be drawn without an outline or left unfilled.</p>

<h2>History</h2>

<p>The DefineShape instruction represents the DefineShape tag from the Macromedia 
Flash (SWF) File Format Specification. It was introduced in Flash 1.</p>
